﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AjaxHomeCommon.aspx.cs" Inherits="Home_AS_AjaxHomeCommon" %>

<%
    switch (Action)
    {
        case "ShowOrderInfo":
%>
<%
    if (_orderList != null && _orderList.Count > 0)
    {
        for (int i = 0; i < _orderList.Count; i++)
        {
                           
                     
%>
<tr class='orderTr'>
    <td class="orderTdTwo">
        <%=_orderList[i].Order.OrderID%>
    </td>
    <td class="orderTdTwo">
        <%
            for (int j = 0; j < _orderList[i].Lines.Count; j++)
            {
                Response.Write(_orderList[i].Lines[j].GoodsName);
            }
        %>
    </td>
    <td class="orderTdTwo">
        <%=_orderList[i].Order.ReceiverName%>
    </td>
    <td class="orderTdTwo">
        <%=_orderList[i].Order.TotalAmount.ToString("C2")%>
    </td>
    <td class="orderTdTwo">
        <%=_orderList[i].Order.OrderDate.ToString("yyyy-MM-dd HH:mm:ss")%>
    </td>
    <td class="orderTdTwo">
        <%=_orderList[i].Order.OrderStatus%>
    </td>
    <td class="orderTdTwo">
     [ <a href='/home/orderreview.aspx?orderid=<%=_orderList[i].Order.OrderID %>'>查看</a> ] [ <a href="pay/alipay.aspx?orderid=<%=_orderList[i].Order.OrderID %>">付款</a> ]
    </td>
</tr>
<%
    }
        //加载分页
        var totalPage = OrderasPage.TotalCount % PageSize == 0 ? OrderasPage.TotalCount / PageSize : (OrderasPage.TotalCount / PageSize + 1);
         

            Response.Write("<tr class='orderTr'><td colspan='7'  class='orderTdTwo' align='right'><a href='javascript:void(0)' onclick='goPage(" + (OrderasPage.CurPage - 1 > 0 ? OrderasPage.CurPage - 1 : OrderasPage.CurPage) + ");'>上一页</a> <a href='javascript:void(0)' onclick='goPage(" + (OrderasPage.CurPage + 1 > totalPage ? totalPage : (OrderasPage.CurPage + 1)) + ");'>下一页</a></td></tr>");
         
    }
    else
    {
        Response.Write("<tr class='orderTr'><td colspan='7'  class='orderTdTwo'>查无相关数据</td></tr>");
    }%>
<%
    Response.End();
    break;
    }

    
%>